package com.atguigu.java.ai.langchain4j.controller;
import com.atguigu.java.ai.langchain4j.entity.Orders;
import com.atguigu.java.ai.langchain4j.service.impl.OrdersServiceImpl;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Tag(name = "操作数据库")
@RestController
@RequestMapping("/order")
public class OrderController {
    @Autowired
    OrdersServiceImpl ordersServiceImpl;
    @GetMapping("/getUserInfo")
    public Orders getOrderById(@RequestParam("id") Integer id) {
        return ordersServiceImpl.getById(id);
    }
    @GetMapping
    @ResponseBody
    public List<Orders> getOrderByList(){
        return ordersServiceImpl.list();
    }
}
